'use strict';
/**
 * @fileoverview 走马灯
 * @author sundbcn@gmail.com (sun debing)
 */

var mongoose = require('mongoose');
var moment = require('moment');
var _ = require('lodash');
var constantUtil = require('../util/constantUtil');
var chatMgr = require('../mgr/chatMgr');
var dataApi = require('../libs/dataApi');

var _nowTime = function () {
    return moment().unix();
};

/**
 * 走马灯
 */
var marqueeSchema = new mongoose.Schema({

    // 优先级别
    sort_id: {
        type: Number
    },

    // 走马灯信息加入列表时间
    create_time: {
        type: Number,
        default: _nowTime
    },

    // 任务类型 1: 定时任务 0: 非定时任务
    is_time: {
        type: Number,
        required: true
    },

    // 间隔时间
    interval_time: {
        type: Number,
        default: 0
    },

    // 推送次数
    times: {
        type: Number,
        default: 1
    },

    // 文本信息
    text: {
        type: String,
        default: ''
    }

});

mongoose.model('Marquee', marqueeSchema);
